#ifndef __CPP_SIDE_H__
#define __CPP_SIDE_H__

#if __cplusplus
extern "C" {
#endif

#include <stddef.h>

struct MlirContext;
struct MlirValue;
struct MlirOperation;
struct MlirDialectRegistry;
struct MlirPass;

typedef struct MlirContext MlirContext;
typedef struct MlirValue MlirValue;
typedef struct MlirOperation MlirOperation;
typedef struct MlirDialectRegistry MlirDialectRegistry;
typedef struct MlirPass MlirPass;

void mlirLoadToyDialect(MlirContext rawContext);
void *mlirScopedHashTableCreate();
void mlirScopedHashTableDestroy(void *scopedHashTable);
const void *mlirScopedHashTableScopeCreate(void *scopedHashTable);
void mlirScopedHashTableScopeDestroy(const void *scopedHashTableScope);
int mlirDeclare(void *scopedHashTable, const char *name, size_t length, MlirValue rawValue);
MlirValue mlirLookup(void *scopedHashTable, const char *name, size_t length);
void *mlirDynCastShapeInference(MlirOperation rawOp);
void mlirShapeInferenceInferShapes(void *shapeInference) ;
void mlirSetPrivate(MlirOperation rawOp);
void mlirFuncRegisterAllExtensions(MlirDialectRegistry rawRegistry);
MlirPass mlirToyCreateLowerToAffinePass();
MlirPass mlirAffineCreateLoopFusionPass();
MlirPass mlirAffineCreateAffineScalarReplacementPass();
int mlirDumpLLVMIR(MlirOperation rawOperation, int enableOpt);
int mlirRunJit(MlirOperation rawOperation, int enableOpt);
void mlirLLVMRegisterInlinerInterface(MlirDialectRegistry rawRegistry);
MlirPass mlirToyCreateLowerToLLVMPass();
MlirPass mlirLLVMCreateDIScopeForLLVMFuncOpPass();

#if __cplusplus
}
#endif

#endif
